/**
 * @file       CKeyboardListener.cpp
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Jan 13, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#include "KeyboardListener.h"
#include "IEventListener.h"
#include "Frame.h"
#include "IEvent.h"
#include "EventHandler.h"
#include "errorcode.h"
#include "KeyboardEvent.h"

namespace NS_LCD_AFW
{

CKeyboardListener::CKeyboardListener()
{
}

CKeyboardListener::~CKeyboardListener()
{
}

CKeyboardListener::CKeyboardListener(CEventHandler *pEventHandler,
		bool bAutoRelease) :
		IEventListener(pEventHandler, bAutoRelease)
{
}

CKeyboardListener::CKeyboardListener(CEventHandler *pEventHandler,
		int interestEventId, AFW_EventCallBack callBack, int param,
		bool bAutoRelease) :
		IEventListener(pEventHandler, interestEventId, callBack, param,
				bAutoRelease)
{
}

int CKeyboardListener::actionPerformed(IEvent *pEvent)
{

	if (NULL == pEvent)
	{
		return ERR_INVALID_EVENT;
	}

	CKeyboardEvent *pKeyboardEvent = dynamic_cast<CKeyboardEvent*>(pEvent);
	if (NULL == pKeyboardEvent)
	{
		return ERR_NOT_KEYBOARD_EVENT;
	}

	return IEventListener::actionPerformed(pEvent);
}

} /* namespace NS_LCD_AFW */
